<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
    <meta charset="UTF-8">
    <title>SSO Client - Home</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
    <style>
        body {
            padding-top: 20px;
            background-color: #f8f9fa;
        }
        .container {
            max-width: 800px;
        }
        .card {
            margin-top: 20px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        .welcome-message {
            color: #28a745;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="text-center">
            <h1 class="display-4">欢迎回来！</h1>
            <p class="lead welcome-message">您已成功通过OIDC单点登录系统登录</p>
            
            <div class="card">
                <div class="card-body">
                    <h3>用户信息</h3>
                    <div class="row">
                        <div class="col-md-6">
                            <p><strong>用户名:</strong> <span th:text="${userName}"></span></p>
                            <p><strong>邮箱:</strong> <span th:text="${email}"></span></p>
                            <p><strong>用户ID:</strong> <span th:text="${sub}"></span></p>
                        </div>
                        <div class="col-md-6">
                            <a th:href="@{/userinfo}" class="btn btn-info">查看详细信息</a>
                            <form th:action="@{/logout}" method="post" style="display: inline-block;">
                                <button type="submit" class="btn btn-danger">退出登录</button>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>